<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrapper">
      <a-form layout="inline" :form="form" @submit="handleSubmit">
        <a-row :gutter="48">
          <a-col :md="8" :sm="24">
            <a-form-item label="直播间">
              <a-input placeholder="请输入直播间"
                v-decorator="['roomIds', { rules: [{ required: true, message: '请输入直播间' }] },]" />
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <a-form-item label="品牌">
              <a-select v-decorator="[
                'brandId',
                { rules: [{ required: true, message: '请选择品牌' }] },
              ]" placeholder="请选择品牌" @change="handleSelectChange">
                <a-select-option :value="item.weid" v-for="item in brand" :key="item.weid">
                  {{ item.name }}
                </a-select-option>

              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="8" :sm="24">
            <span class="table-page-search-submitButtons">
              <a-button type="primary" html-type="submit">同步</a-button>
              <a-button style="margin-left: 8px" @click="reset">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
  </a-card>
</template>
<script>
import { asyncRoom } from '@/api/micromall/live'
export default {
  name: 'asyncLive',
  data() {
    return {
      form: this.$form.createForm(this),
      queryParam: {
        groupCardNo: ''
      },
      brand: [{
        weid: 2738574294,
        name: 'JNBY'
      }, {
        weid: 2822095692,
        name: 'less'
      }, {
        weid: 2504948039,
        name: 'CROQUIS'
      }, {
        weid: 4,
        name: 'jnby by JNBY'
      }, {
        weid: 6924108367,
        name: 'Pomme de terre'
      }, {
        weid: 15,
        name: 'APN73'
      }, {
        weid: 8348044436,
        name: 'JNBYHOME'
      }, {
        weid: 11,
        name: 'Outlet'
      }, {
        weid: 5,
        name: '江南布衣+'
      }]
    }
  },
  methods: {
    async submit(values) {
      const re = await asyncRoom(values)
      if (re.code == 200) {
        this.$message.success('异步处理中...')
      }else{
        this.$message.error(res.msg || res.message)
      }
      console.log(re)
    },
    reset() {
      this.form.resetFields()
    },
    handleSubmit(e) {
      e.preventDefault();
      this.form.validateFields((err, values) => {
        if (!err) {
          this.submit(values);
        }
      });
    },
    handleSelectChange(value) {
      // this.form.setFieldsValue({
      // note: `${value}`,
      // });
    }
  }
}
</script>
<style scoped></style>